import csv

with open('scores.csv','r') as file:
    reader=csv.reader(file)
    next(reader)
    data=list(reader)

scores=[]
for row in data:
    scores.append(int(row[2]))
print(scores)

def calc_mean(scores):
    return sum(scores)/len(scores)

def calc_median(scores):
    sorted_scores = sorted(scores)
    n =len(sorted_scores)
    return sorted_scores[n//2]

from collections import Counter
def calc_mode(scores):
    counter=Counter(scores)
    max_count=max(counter.values())
    return [k for k,v in counter.items()if v==max_count]

mean=calc_mean(scores)
median=calc_median(scores)
mode=calc_mode(scores)[0]
print(f"The mean is {mean}")
print(f"The median is {median}")
print(f"The mode is {mode}")